package com.qun.admin.server;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

import de.codecentric.boot.admin.server.config.EnableAdminServer;

@EnableDiscoveryClient
@EnableAdminServer
@SpringBootApplication
public class ApplicationAdminServer implements CommandLineRunner, DisposableBean {

	private static final Logger logger = LoggerFactory.getLogger(ApplicationAdminServer.class);

	public static void main(String[] args) {
		SpringApplication.run(ApplicationAdminServer.class, args);
	}

	@Override
	public void run(String... args) throws Exception {
		logger.info("**********************************************");
		logger.info("Spring Admin 监控服务器启动.....");
		logger.info("**********************************************");
	}

	@Override
	public void destroy() throws Exception {
		logger.info("**********************************************");
		logger.info("Spring Admin 监控服务器关闭.....");
		logger.info("**********************************************");
	}
}
